package org.qqcui.designpattern.patterns.memorandum.simple;

import java.util.ArrayList;
import java.util.List;

/**
 * 守护者对象，保存了一系列的状态
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/7 10:19
 **/
public class CareTaker {

    private List<Memento> mementos = new ArrayList<>();

    public void add(Memento memento) {
        mementos.add(memento);
    }

    public Memento get(int index) {
        return mementos.get(index);
    }
}
